package com.xkdx.guangguang;

import java.util.List;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;

import com.weibo.sdk.android.sso.SsoHandler;
import com.xkdx.caipiao.R;
import com.xkdx.guangguang.fragment.brand.BrandFragment;
import com.xkdx.guangguang.fragment.comment.ShopCommentFragment;
import com.xkdx.guangguang.module.statics.IConstants;
import com.xkdx.guangguang.shareclass.BrandDetail;

public class BrandActivity extends ManagerActivity {
	List<BrandDetail> list;

	@Override
	protected void onCreate(Bundle arg0) {
		// TODO Auto-generated method stub
		super.onCreate(arg0);
		IConstants.BottomBtnSelected = 2;
		BrandFragment brandFragment = new BrandFragment();
		getSupportFragmentManager().beginTransaction()
				.replace(R.id.fragment, brandFragment).commit();
		IConstants.BottomBtnSelected = 2;
	}

	public List<BrandDetail> getSearchBrandList() {
		return list;
	}

	public void setSearchBrandList(List<BrandDetail> list) {
		this.list = list;
	}

	@Override
	protected void onStart() {
		IConstants.BottomBtnSelected = 2;
		super.onStart();
	}

	@Override
	public void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		FragmentManager fm = getSupportFragmentManager();
		if (IConstants.LoginWhich == 6) {
			SsoHandler ssohandler = null;
			ssohandler = ((ShopCommentFragment) fm
					.findFragmentByTag("shopCommentaryFragment"))
					.GetBindSsoHandler();
			if (ssohandler != null) {
				ssohandler.authorizeCallBack(requestCode, resultCode, data);
			}
		}
	}

}
